Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return empty array if no relationships are found #156

Merged
merged 1 commit into from
Mar 10, 2014

Conversation

jazminschroeder
Copy link
Contributor

Awesome gem!

This PR returns an empty array instead of nil when no relationships are found.

@@ -39,7 +39,7 @@ def get(id, other_id, direction = "all", types = [nil])

node_relationships = @connection.post(base_path(:id => get_id(id)), options) || []

return nil if node_relationships.empty?
return [] if node_relationships.empty?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just replace this entire section by @connection.post(base_path(:id => get_id(id)), options) || [].

maxdemarzi added a commit that referenced this pull request Mar 10, 2014
return empty array if no relationships are found
@maxdemarzi maxdemarzi merged commit f2d11ef into maxdemarzi:master Mar 10, 2014
@maxdemarzi
Copy link
Owner

Thanks!

maxdemarzi added a commit that referenced this pull request Mar 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants